package com.yunqing.restkeeper.web.common.response.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName GlobalExceptionHandler
 * @Description 异常拦截
 * @author: puyunqing
 * @Date: 2025/6/16
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Object Exception(Exception ex) {
        Map<String, Object> errorMap = new HashMap<String, Object>();
        errorMap.put("errCode", "00000");
        errorMap.put("errMessage", ex.getMessage());
        return errorMap;
    }
}
